<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">   

         <style> 
            
            .formPost:dataTable:j_idt30{
            font-family: verdana;
            font-size: 12px;
            font-weight: bold;            
        }
            .ui-stack, 
            .ui-stack .ui-stack { 
                font-size: 20px !important;
                text-align: right !important; 
            }
            
            .rotulos{
                font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;
            }

        </style>

        <script>(function(d, s, id) {	
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>

        <!-- Faça o include da lib do jQuery -->
        <script type="text/javascript" src="/lib/scripts/jquery.js"></script>    
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />

     
        <p:dialog id="postDialog" header="Comentários" widgetVar="postDialog" resizable="false" draggable="false" >

       
        <p:dataTable id="dataTable" var="comment"  value="#{commentBean.comments}"  
                 paginator="true" rows="5"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">  
            

                <f:facet name="header" >  
                    <p style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;">#{commentBean.titulo}</p>
                </f:facet>  

                <p:column>  
                    <f:facet name="header" >  
                        <h:outputText value="Usuário" style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;"/>  
                    </f:facet>  
                    <h:outputText value="#{comment.username}" style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;" />  
                </p:column>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Comentário" style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;"/>  
                    </f:facet>  
                    <h:outputText value="#{comment.comentario}" style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;"/>  
                </p:column>  

                <p:column >  
                    <f:facet name="header">  
                        <h:outputText value="Excluir" style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;"/>  
                    </f:facet>  
                 
                    <p:commandButton style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;"  action="#{commentBean.deletaComentario}"  icon="ui-icon-close"   >
                        <f:setPropertyActionListener target="#{commentBean.codPost}" value="#{comment.codComentario}" />
                    </p:commandButton>
                </p:column> 
             
            <f:facet name="footer" rendered="#{loginBean.render}">
                    <p:commandButton  style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;" onclick="commentDialog.show()"  value="Comentar" rendered="#{loginBean.render}" >
                    </p:commandButton>
                </f:facet>
           
            </p:dataTable>  
       
    </p:dialog>

</html>
